<?php
if(!defined('BZ_XTBLOG') || !defined('BZ_WJSCUZ')) {
	exit('Access Denied');
}
if(!plugin_Authorize(plugin_szname('Bingz_liaotian_password'))) {
    $plugin_title='插件未授权 - ';
    $plugin_keywords='插件未授权,';
    $plugin_description='插件未授权 - ';
    $plugin_password_name=$plugin_password_name_ts;
}else{
$plugin_title='聊天室 - ';
$plugin_keywords='聊天室,';
$plugin_description='聊天室 - ';
$management_je=plugin_szname('Bingz_liaotian_money');
$management_name=Bingz_management_name(plugin_szname('Bingz_liaotian_fangs'));
$act =$_GET['act'];
$user_czqx=$user_class->user_qx('','',$user_uid);
   $sql_bbsff  =$db->query('plugin_liaotian_xhw',"type = '1' ",'');
   while($roww_b=mysql_fetch_array($sql_bbsff)){
   	     if($roww_b[time_a] > '0' && $roww_b[time_a] < $time ){
   	        $db->update('plugin_liaotian_xhw',"type = '0'"," `id` = '$roww_b[id]'");
   	     }
   }
if($act == 'bz'){
	 $pdid="2";
}else if($act == 'cj'){
   if(!$user_uid){
	     $pdid='1';
   }else{
	     $pdid='3';
	}
}else if($act == 'hw'){
	 $sql_bbsff  =$db->query('plugin_liaotian_xhw',"type = '1' ORDER BY `id` DESC ",'');
   while($roww_b=mysql_fetch_array($sql_bbsff)){
   	     $userhy=$db->get_one('plugin_liaotian_class'," `id` = '$roww_b[lid]' ",'');
   	     $jyts=floor(($roww_b[time_a]-$roww_b[time_b])/86400);
   	     $xhw[]= array("id"=> $roww_b[id] ,"lid"=> $roww_b[lid] ,"lname"=> $userhy[name] ,"hyuid"=> $roww_b[uid] ,"hyname"=> $user_class->user_name($roww_b[uid]) ,"jyts"=> $jyts );
   }
   $pdid="4";
}else if($act == 'gl'){
   if(!$user_uid){
	     $pdid='1';
   }else{
   	   if($user_czqx){
   	  	$sql_bbs  =$db->query('plugin_liaotian_class'," ",'');
       }else{
   	  	$sql_bbs  =$db->query('plugin_liaotian_class'," `uid` = '$user_uid'",'');
       }
       while($aaw=mysql_fetch_array($sql_bbs)){
	          $gllts[]= array("name"=>"$aaw[name]","id"=>"$aaw[id]");
       }
	     $pdid='5';
	 }
}else{	
   $num_count=$db->num_rows('plugin_liaotian_class',"`type` ='0'",'id');
   $list_num ="10";
   $num_start=page_num($list_num,$num_count);
   $sql_bbs  =$db->query('plugin_liaotian_class',"`type` ='0' ORDER BY `lsid` DESC LIMIT ".$num_start." , ".$list_num." ",'');
   $a='1';
   while($aaw=mysql_fetch_array($sql_bbs)){
   	    $qxpdd='';
   	    if($a == '1'){
   	    	 $aaw[name]='<font color="#FF8E44">'.$aaw[name].'</font>';
   	    }else if($a == '2'){
   	    	 $aaw[name]='<font color="#FF8E44">'.$aaw[name].'</font>';
   	    }else if($a == '3'){
   	    	 $aaw[name]='<font color="#FF8E44">'.$aaw[name].'</font>';
   	    }else{
   	    	 $sxts=$a;
   	    }
   	    if($aaw[uid] == $user_uid){
   	    	 $qxpdd='1';
   	    }
   	    if(!$aaw[logo]){
   	    	 $aaw[logo]=$plugin_Addmm.'/images/liaotian.jpg';
   	    }
   	    if($userhy=$db->get_one('plugin_liaotian'," `lid` = '$aaw[id]' ORDER BY `id` DESC LIMIT 0,1",'')){
   	    	 $tsname='<b>'.$user_class->user_name($userhy[uid]).'</b>:'.mb_substr($userhy[content],0,10,"utf-8");
   	    }else{
   	    	 $tsname="还没有人聊天哦！";
   	    }
	      $forulb[]= array("tsname"=>"$tsname","logo"=>"$aaw[logo]","flid"=>"$aaw[id]","flname"=>"$aaw[name]","lsid"=>"$aaw[lsid]", 'sxts'=> $sxts, 'qxpdd'=> $qxpdd);
        $a++;
   }
   $page=page_link($list_num,$num_count);
}
$templatesplugin='index.htm';
}
?>